package Client.TaggingSystem

import org.hibernate.Session

/**
 * Class to manage the hibernate-database mapping for the tagging system
 * @param session the sql session
 */
class TagDBManager (session: Session) {
  if (session == null) {
    throw new RuntimeException("Invalid session object")
  }

  /**
   * save a tag in the database
   * @param tag the tag to save
   */
  def saveTag(tag:Tag) {
    session.save(tag)
  }

  /**
   * remove a tag from the database
   * @param tag the tag to remove
   */
  def deleteTag(tag: Tag) {
    session.delete(tag)
  }

}